﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
 	x:Class="MVVMGrid.UsingReactive.Views.GridView"
    mc:Ignorable="d" d:DesignHeight="600" d:DesignWidth="800">
	<UserControl.Resources>
		<Style x:Key="ErrorMsgStyle" TargetType="TextBlock">
			<Setter Property="FontStyle" Value="Italic"/>
			<Setter Property="Foreground" Value="#FFE71010"/>
		</Style>
	</UserControl.Resources>
    
    <Grid x:Name="LayoutRoot" Background="White">
    	<Grid.RowDefinitions>
    		<RowDefinition Height="20"/>
    		<RowDefinition Height="32"/>
    		<RowDefinition Height="10"/>
    		<RowDefinition Height="32"/>
    		<RowDefinition Height="10"/>
    		<RowDefinition/>
    		<RowDefinition Height="40"/>
    	</Grid.RowDefinitions>
    	<Grid.ColumnDefinitions>
    		<ColumnDefinition Width="20"/>
    		<ColumnDefinition/>
    		<ColumnDefinition Width="20"/>
    	</Grid.ColumnDefinitions>
    	<StackPanel Grid.Column="1" HorizontalAlignment="Left" Grid.Row="1" Orientation="Horizontal">
    		<TextBlock TextWrapping="Wrap" Text="Grid Settings: " VerticalAlignment="Center"/>
    		<ComboBox Width="300" VerticalAlignment="Center"
				ItemsSource="{Binding SettingsCollection.Items}"
				SelectedItem="{Binding SelectedSettings, Mode=TwoWay}"
				DisplayMemberPath="Description"
				/>
    	</StackPanel>
		<Grid Grid.Row="3" Grid.Column="1">
			<TextBlock Text="{Binding ViewSettings.Description}" FontStyle="Italic" FontSize="13.333" FontWeight="Bold" />
		</Grid>
    	<sdk:DataGrid x:Name="dataGrid" Grid.Column="1" Grid.Row="5"
			AutoGenerateColumns="False"
			ItemsSource="{Binding DataItems}">
    		<sdk:DataGrid.Columns>
    			<sdk:DataGridTextColumn x:Name="ColumnID" Binding="{Binding One}" Header="ID" Width="*"/>
    			<sdk:DataGridTemplateColumn x:Name="ColumnName" Header="Name" Width="*">
    				<sdk:DataGridTemplateColumn.CellTemplate>
    					<DataTemplate>
    						<TextBlock Text="{Binding Two}" />
						</DataTemplate>
					</sdk:DataGridTemplateColumn.CellTemplate>
    			</sdk:DataGridTemplateColumn>
    			<sdk:DataGridCheckBoxColumn x:Name="ColumnSelect" Binding="{Binding Three}" Header="Select" Width="*"/>
    			<sdk:DataGridTextColumn x:Name="ColumnDesc" Binding="{Binding Four}" Header="Description" Width="*"/>
    			<sdk:DataGridTextColumn x:Name="ColumnTimeStamp" Binding="{Binding Five, StringFormat='s'}" Header="Time Stamp" Width="100"/>
    			<sdk:DataGridTextColumn x:Name="ColumnVerboseDate" Binding="{Binding Five, StringFormat='F'}" Header="Verbose Date" Width="200"/>
    		</sdk:DataGrid.Columns>
    	</sdk:DataGrid>
    	<StackPanel Grid.Column="1" Grid.Row="6" VerticalAlignment="Top">
    		<TextBlock Text="{Binding ErrorMessageOne}" Style="{StaticResource ErrorMsgStyle}" />
    		<TextBlock Text="{Binding ErrorMessageTwo}" Style="{StaticResource ErrorMsgStyle}" />
    	</StackPanel>
    </Grid>
</UserControl>
